home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 80 / XENIATGM80.iso / Goodies / Blood 2 / Source / data.z / MenuCharacter.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-04-02  |  3.7 KB  |  128 lines

  1. //*************************************************************************
  2. //*************************************************************************
  3. //***** MODULE  : MenuCharacter.h
  4. //***** PURPOSE : Blood 2 Character Creation Screen
  5. //***** CREATED : 10/11/98
  6. //*************************************************************************
  7. //*************************************************************************
  8.  
  9. #if !defined(AFX_MENUCHARACTER_H__D7668B32_57D4_11D2_BDA0_0060971BDC6D__INCLUDED_)
  10. #define AFX_MENUCHARACTER_H__D7668B32_57D4_11D2_BDA0_0060971BDC6D__INCLUDED_
  11.  
  12. #if _MSC_VER >= 1000
  13. #pragma once
  14. #endif // _MSC_VER >= 1000
  15.  
  16. //*************************************************************************
  17.  
  18. #include "MenuBase.h"
  19. #include "SharedDefs.h"
  20.  
  21. //*************************************************************************
  22.  
  23. #ifdef _ADDON
  24. #define        MAX_CHARACTER_INFO        28
  25. #else
  26. #define        MAX_CHARACTER_INFO        20
  27. #endif
  28.  
  29. #define        MAX_ATTRIBUTE            5
  30.  
  31. #define        ARROW_CTRLS                0
  32.  
  33. #define        MIN_STAT_INDEX            1
  34. #define        MAX_STAT_INDEX            4
  35.  
  36. #define        MIN_WEAPON_INDEX        5
  37. #define        MAX_WEAPON_INDEX        13
  38.  
  39. //*************************************************************************
  40.  
  41. typedef struct CharacterMenuInfo
  42. {
  43.     char    *szFile;
  44.     DDWORD    nCharacter;
  45.     DDWORD    nColor;
  46. }    CharacterMenuInfo;
  47.  
  48. //*************************************************************************
  49.  
  50. class CMenuCharacter : public CMenuBase  
  51. {
  52.     public:
  53.         CMenuCharacter();
  54.         virtual ~CMenuCharacter();    
  55.  
  56.         // Build the menu
  57.         void    Build();        
  58.  
  59.         // Override the left and right controls
  60.         void    OnLeft();
  61.         void    OnRight();
  62.  
  63.         // Renders the menu to a surface
  64.         void    Render(HSURFACE hDestSurf);
  65.  
  66.         // This is called to determine whether we should ask the user if they wish to switch
  67.         // resolutions back to the previous resolution if it had been changed to 640x480.
  68.         void    SetResolutionSwitch(DBOOL bAsk, int nOldWidth, int nOldHeight);
  69.  
  70.         // This is called when the menu gets or loses focus
  71.         void    OnFocus(DBOOL bFocus);
  72.  
  73.         // Extra member functions for file control
  74.         DBOOL    SaveB2CFile(char *szFile);
  75.         DBOOL    LoadB2CFile(char *szFile);
  76.         DBOOL    DeleteB2CFile(char *szFile);
  77.  
  78.         void    UpdateScreenFromStruct();
  79.  
  80.     protected:
  81.         DDWORD    OnCommand(DDWORD dwCommand, DDWORD dwParam1, DDWORD dwParam2);
  82.  
  83.         void    BuildExtraCtrls();
  84.  
  85.         void    CheckSelectedLinks();
  86.  
  87.         void    ChangeCharacterPic(int index);
  88.         void    UpdateCharacterStruct();
  89.         void    SetPlayerIndexFromStruct();
  90.  
  91.         DBOOL    IsWeaponADupe(int index);
  92.  
  93.         // Custom control setup functions
  94.         CLTGUIFadeItemCtrl* InitFadeItemCtrl(char *lpszOptionSurfPrefix, int nSurfaces, char *lpszOptionText, DWORD dwCommandID, int x, int y);
  95.         CLTGUITextItemCtrl* InitNumberCtrl(int low, int high, int index, DWORD dwCommandID, int x, int y);
  96.         CLTGUITextItemCtrl* InitWeaponCtrl(int index, DWORD dwCommandID, int x, int y, DBOOL enable);
  97.         CLTGUITextItemCtrl* InitWeaponNumCtrl(int index, DWORD dwCommandID, int x, int y, DBOOL enable);
  98.  
  99.         // Extra member variables
  100.         HSURFACE    m_hCharacterPic;
  101.         HDECOLOR    m_hTransColor;
  102.  
  103.         int            m_PlayerIndex;
  104.         DDWORD        m_ExtraPoints;
  105.  
  106.         B2C            m_Player;
  107.  
  108.         CLTGUIFadeItemCtrl        *m_hRightArrow;
  109.  
  110.         CLTGUITextItemCtrl        *m_hStats[4];
  111.  
  112.         CLTGUIFadeItemCtrl        *m_hExtraCtrl;
  113.         CLTGUITextItemCtrl        *m_hExtraNumCtrl;
  114.  
  115.         CLTGUIFadeItemCtrl        *m_hWeaponsCtrl;
  116.         CLTGUITextItemCtrl        *m_hWeaponNums[10];
  117.         CLTGUITextItemCtrl        *m_hWeapons[10];
  118.  
  119.         DBOOL        m_bSwitchResolutions;
  120.         DBOOL        m_bGoingToFilesMenu;
  121.  
  122.         int            m_nOldScreenWidth;
  123.         int            m_nOldScreenHeight;
  124. };
  125.  
  126. //*************************************************************************
  127.  
  128. #endif // !defined(AFX_MENUCHARACTER_H__D7668B32_57D4_11D2_BDA0_0060971BDC6D__INCLUDED_)